package com.dycong.common.leetcode.yi;

import java.util.PriorityQueue;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: yilin
 * Date: 2019-09-05
 * Time: 12:16
 */
public class PriorityQueueTest {

    public static void main(String[] args) {
        test();
    }

    public static void test() {
        PriorityQueue<Integer> minQueue = new PriorityQueue<>(20);
        minQueue.add(3);
        minQueue.add(5);
        minQueue.add(1);
        minQueue.add(2);
        minQueue.add(7);
        minQueue.add(4);
        minQueue.add(20);

        while (!minQueue.isEmpty()) {
            System.out.print(minQueue.poll() + "\t");
        }
    }
}
